import { createWebHistory, createRouter } from 'vue-router'

import autoPage from './utils/auto-route.js'

const routes = [
  {
    //  path: ``, redirect: `/chat` },
    path: `/`,
    component: () => import('./views/agent/index.vue'),
  },
  {
    //  path: ``, redirect: `/chat` },
    path: `/web`,
    component: () => import('./views/web/index.vue'),
  },
  {
    path: `/:catchAll(.*)*`,
    component: () => import('./views/index.vue'),
  },
  ...autoPage(),
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
